﻿@model Webcar.Entitys.BS_EMP
@using (Ajax.BeginForm("EditSave", "Driver",
    new AjaxOptions
    {
        HttpMethod = "POST",
        //OnBegin = "function(){ loadingPanel.Show(); }",
        //OnComplete = "function(){ loadingPanel.Hide(); }",
        UpdateTargetId = "error-content",
        InsertionMode = InsertionMode.Replace
    }))
{
    @Html.AntiForgeryToken()
    <div id="edit-car">
        @Html.HiddenFor(a => a.MAN_CODE)
        @Html.HiddenFor(a => a.IS_USE)

        <table class="edit-table">
            <tr>
                <td style="width: 100px; text-align: right">*姓名：</td>
                <td style="width: 200px">@Html.TextBoxFor(a => a.MAN_NAME, new { @style = "width: 100%;", @onkeyup = "this.value=this.value.toUpperCase();" })</td>
                <td style="width: 100px; text-align: right">*性别：</td>
                <td style="width: 200px">@Html.DropDownListFor(a => a.SEX, WebcarDataHelper.SexDropDown, new { @style = "width: 100%;"})</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">*所属单位：</td>
                
                 @if (Model.MAN_CODE == null)
                { 
                    <td>@Html.DropDownListFor(a => a.DEPT_CODE, WebcarDataHelper.UserSuperDeptList, new { @style = "width: 100%;", @onchange = "retriveChildDept();" })</td>
                }
                else
                {
                    <td>@ViewBag.DeptName
                        @Html.HiddenFor(a => a.DEPT_CODE)
                        </td>
                }
                
                
                <td style="width: 100px; text-align: right">下级单位：</td>
                <td>@Html.DropDownListFor(a => a.CHILD_DEPT, WebcarDataHelper.GetChildDeptByDeptList(Model.DEPT_CODE), new { @style = "width: 100%;" })</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">*用工类别：</td>
                <td >@Html.DropDownListFor(a => a.JOB_KIND,new SelectList(WebcarDataHelper.JobKind,"Item1","Item2"), new { @style = "width: 100%;" })</td>
                <td style="width: 100px; text-align: right;">*是否发证：</td>
                <td colspan="3">@Html.CheckBoxFor(a => a.CardFlag,new { @style = "width: 100%;" })</td>

            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">档案号：</td>
                <td>@Html.TextBoxFor(a => a.ARCHIVES_NO)</td>
                <td style="width: 100px; text-align: right">身份证号：</td>
                <td>@Html.TextBoxFor(a => a.ID, new { @style = "width: 100%;" })</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">*准驾车型：</td>
                <td>@Html.TextBoxFor(a => a.DRIVE_KIND)</td>
                <td style="width: 100px; text-align: right">*驾照号：</td>
                <td>@Html.TextBoxFor(a => a.DRIVE_NO, new { @style = "width: 100%;" })</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">*初次领证时间：</td>
                <td>@Html.CalendarFor(a => a.DRIVE_FIRST)</td>
                <td style="width: 100px; text-align: right">出生日期：</td>
                <td>@Html.CalendarFor(a => a.BIRTH)</td>
            </tr>

            <tr>
                <td style="width: 100px; text-align: right;">电话：</td>
                <td>@Html.TextBoxFor(a => a.PHONE, new { @style = "width: 100%;" })</td>
                <td style="width: 100px; text-align: right">教育程度：</td>
                <td>@Html.DropDownListFor(a => a.EDUCATION,new SelectList(WebcarDataHelper.Education,"Item1","Item2"), new { @style = "width: 100%;" })</td>

            </tr>

            <tr>
                <td style="width: 100px; text-align: right;">家庭住址：</td>
                <td>@Html.TextBoxFor(a => a.ADDRESS)</td>
                <td style="width: 100px; text-align: right">技能等级：</td>
                <td>@Html.DropDownListFor(a => a.class_level,new SelectList(WebcarDataHelper.ClassLevel,"Item1","Item2"), new { @style = "width: 100%;" })</td>
            </tr>
        </table>


        <br />
        @Html.ErrorLabel("error-content")

    </div>
    <div class="edit-button">
        @Html.DevExpress().Button(settings =>
        {
            settings.Name = "Button1";
            settings.Text = CurrentUser.CheckPermission(PermissionManager.编辑驾驶员) ? "保存" : "无权限";
            settings.Enabled = CurrentUser.CheckPermission(PermissionManager.编辑驾驶员);
            settings.UseSubmitBehavior = true;
            settings.Width = 70;
            settings.ControlStyle.CssClass = "button1";
        }).GetHtml()
        @Html.DevExpress().Button(settings =>
        {
            settings.ControlStyle.CssClass = "button2";
            settings.Name = "Button2";
            settings.Text = "取消";
            settings.Width = 70;
            settings.ClientSideEvents.Click = "function(s, e){ pcModalMode.Hide(); }";

        }).GetHtml()
    </div>
}

